<html>
   <head>
       <title>Transplants Placeholder</title>
       <script type="text/javascript" src="http://www.google.com/jsapi"></script>
       <script type="text/javascript">
           google.load("prototype", "1.6.1.0");
       </script>       
       <script type="text/javascript">
           function load_params() {
               var queryString = decodeURI(window.location.search.substring(1));
               var queryParams = queryString.toQueryParams();
               var patients = queryParams["patients"];

               $("container_patients").innerHTML = patients;
               $("container_genes").innerHTML = queryParams["genes"];

               $("container_files").innerHTML = "";
               
               $A(patients).each(function(patient) {
                   new Ajax.Request("/addama/indexes/csacr.org" + patient + "/Pickle", {
                       method: "get",
                       onSuccess: function(o) {
                           var json = o.responseJSON;
                           var html = "";
                           if (json.references) {
                               $A(json.references).each(function(reference) {
                                   html += reference.local + "<br/>";
                               });
                           }
                           $("container_files").innerHTML += html;
                       }
                   })
               });
           }
           
           Event.observe(window, "load", load_params);
       </script>
   </head>
    <body>
        <h3>Patients</h3>
        <div id="container_patients"></div>

        <h3>Genes</h3>
        <div id="container_genes"></div>

        <h3>Files</h3>
        <div id="container_files"></div>
    </body>
</html>

